<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
     <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
	<title>地址管理</title>
	<style type="text/css">
	*{
		margin: 0px;
		padding: 0px;
	}	
	body{
		width: 100%;
		background: #f2f2f2;
	}
	li{
		list-style: none;
		line-height: 40px;
		margin-bottom: 5px;
		background: white;
		position: relative;
	}
	span{
		margin-left: 5px;
		display: block;
	}
	input{
       margin-left: 5px;
		display: block;
		font-size: 16px;
		outline: none;
		border:none;
	}
	img{
		position: absolute;
		right: 10px;
		bottom: 10px;
		width: 30px;
	}
	</style>
</head>
<body>
    <ul>
    	<li class="item"><span>北京理工大学</span> <input id="text1" type="text" name="" value="男生宿舍8栋612" readonly="readonly"><img id="img1" src="/img/change.png"></li>
    	<li class="item"><span>北京理工大学</span> <input id="text2" type="text" name="" value="男生宿舍8栋612" readonly="readonly"><img id="img2" src="/img/change.png"></li>
    	<li class="item"><span>北京理工大学</span> <input id="text3" type="text" name="" value="男生宿舍8栋612" readonly="readonly"><img id="img3" src="/img/change.png"></li>
    </ul>
   <script type="text/javascript">
   	     $("img").click(function () {
     	var name="text"+$(this).attr("id").substr($(this).attr("id").length-1,1);
     	 var cObj = document.getElementById(name);
     	
     	 if (cObj.style.borderRight=="none") {
     	 	 cObj.style.border="1px solid gray";
             cObj.removeAttribute("readonly");
     	 }else{
             cObj.style.border="none";
             cObj.setAttribute("readonly",'true');  
     	 }	
     })
   	     $("li").click(function(){
   	     	
   	     	$(this).css("background","#acd000");
   	     	$(this).children().css("background","#acd000");
   	     	$(this).siblings().css("background","white");
   	     	$(this).siblings().children().css("background","white");
   	    })
   </script>
</body>
</html>